/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package anjos.util;

import java.util.ArrayList;
import java.util.List;
import javax.faces.model.SelectItem;

/**
 *
 * @author adam
 */
public class SelectItemUtil {

    private List<SelectItem> lista;

    public SelectItemUtil addItem(String label, Object value) {
        if (lista == null) {
            lista = new ArrayList<SelectItem>();
        }

        SelectItem item = new SelectItem();
        item.setLabel(label);
        item.setValue(value);

        lista.add(item);
        return this;
    }

    public List<SelectItem> result() {
        return lista;
    }
}
